-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add lint for transmute from &T to &mut T of a ADT argument #15992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
4d4c366 to
61c208c
Compare
8b63f22 to
cbe29ff
Compare
27d8267 to
fb142f2
Compare
|
Edit: The way I am doing it now, I take the let _: Result<Option<&mut f32>, &usize> = std::mem::transmute(Option::<Result<&f32, usize>>::Some(Ok(&2f32)));Because in the order of the |
|
No changes for 1cc591c |
9df378f to
6d0d072
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
6d0d072 to
053c5b8
Compare
…t adts with different arities
053c5b8 to
1cc591c
Compare
Checks transmutes between the same ADT, making sure type arguments don't go from
&Tto&mut T.Like it would catch something like:
changelog: new lint [
mutable_adt_argument_transmute]fixes #372